package com.heima.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.kafka.core.KafkaTemplate;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author itheima
 * @since 2022-07-14
 */

  @RestController
public class TestController {

    @Autowired
    private KafkaTemplate<String,String> kafkaTemplate;
    @GetMapping("hello")
    public String test(String message)
    {
            kafkaTemplate.send("itcast-topic","我是一号");
        return "ok";
    }
}
